<?php
$this->load->view("header");
?>
<div id="main_content">
<div class="top_margin"></div>

<div class="homepage_mid_column">

<b>配送方式：</b>
<?php if($deliver_type==0)
  echo "紫金港白沙架空层004自取";
   else
   echo "配送地址：".$client->address;
?>

<div>
    <h4>订单所有书籍：</h4>
    <table>
        <tr>
            <th width="100px">书籍名称</th>
            <th width="100px">作者</th>
            <th width="100px">版本</th>
            <th width="100px">书易售价</th>
        </tr>
        <?PHP
        $total_money=0;
        foreach($order_books as $book){
            echo "<tr>";
            echo "<td width=\"200px\" align=\"center\">" .$book->title. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$book->author. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$book->edition. "</td>";
            echo "<td width=\"100px\" align=\"center\">" .$book->price. "</td>";
            //echo "<td align=\"center\">---</td>";
            echo "</tr>";
            $total_money+=$book->price;
        }
        ?>
    </table>
    <?php
       if($deliver_type==1&&count($order_books)<5){
            $total_money+=2;
            echo "<b>运费2元</b><br />";
       }
       echo "<b>订单总金额：".$total_money."元</b>"
     ?>
</div>

<form method ="post" action="<?=site_url()?>/zjub2c/order_confirm_handle">
    <input type="hidden" name="deliver_type" value="<?=$deliver_type?>">
    <input type="hidden" name="total_money" value="<?=$total_money?>">
    <?php
    $arrclient= (array)$client;  //对象到数组强制转换，因为POST不支持对象，为下一步POST赋值做准备
    foreach($arrclient as $key=>$value){
    ?>
    <input type="hidden" name="client[<?=$key?>]" value="<?=$value?>">
    <?php } ?>
    <?php foreach($bookid as $id){ ?>
    <input type="hidden" name="bookid[]" value="<?=$id?>">
    <?php } ?>
    <input type="submit" value="确认购买！">
</form>

</div>


<div class="bottom_margin"></div>
<div class="div-footer"><div class="div-footer-intl-links"></div>
<div class="div-footer-links"></div>
<?=anchor('bookiki/index', '首页');?> - <?=anchor('bookiki/about', '关于书易');?> - <?=anchor('bookiki/about_eng', 'About Bookiki');?> - <?=anchor('bookiki/faq', '使用帮助');?>
&nbsp;-&nbsp;©2009&nbsp;-&nbsp;
<a href="http://www.miibeian.gov.cn/">浙ICP备09067748号</a>
</div>  <!--div-footer-->


</div> <!--main_content-->

</div>  <!--end of body agent-->
</body>
</html>